package com.yunhe.device.service.base;

import com.github.stuxuhai.jpinyin.PinyinException;
import com.yunhe.common.exception.ArgumentErrorException;
import com.yunhe.common.exception.ObjectNotFoundException;
import com.yunhe.common.exception.UniqueConstraintsException;
import com.yunhe.device.domain.base.DeviceType;
import com.yunhe.device.model.base.*;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @ClassName EquipmentTypeService
 * @Description TODO
 * @Author HeTao
 * @Date 2021/7/15 13:27
 * @Version 1.0
 **/
public interface EquipmentTypeService {

    @Transactional(rollbackFor = Exception.class, transactionManager = "transactionManager")
    DeviceType createEquipmentType(EquipmentTypeBo equipmentTypeBo) throws UniqueConstraintsException, ArgumentErrorException, PinyinException;

    Iterable<EquipmentTypeVo> getEquipmentTypeByCondition(EquipmentTypeQueryCondition equipmentTypeQueryCondition);

    Iterable<EquipmentTypeVo> getFrontEquipmentTypeByCondition(EquipmentTypeQueryCondition equipmentTypeQueryCondition) throws ArgumentErrorException;

    EquipmentTypeVo getEquipmentTypeById(Long id) throws ObjectNotFoundException;

    @Transactional(rollbackFor = Exception.class, transactionManager = "transactionManager")
    void deleteEquipmentTypeById(Long id) throws ObjectNotFoundException, ArgumentErrorException;

    @Transactional(rollbackFor = Exception.class, transactionManager = "transactionManager")
    void deleteFrontEquipmentTypeById(Long id) throws ObjectNotFoundException, ArgumentErrorException;

    @Transactional(rollbackFor = Exception.class, transactionManager = "transactionManager")
    DeviceType updateEquipmentType(EquipmentTypeBo equipmentType) throws ObjectNotFoundException, UniqueConstraintsException, ArgumentErrorException, PinyinException;

    @Transactional(rollbackFor = Exception.class, transactionManager = "transactionManager")
    DeviceType updateFrontEquipmentType(EquipmentTypeBo equipmentTypeBo) throws ObjectNotFoundException, ArgumentErrorException, UniqueConstraintsException, PinyinException;

    @Transactional(rollbackFor = Exception.class, transactionManager = "transactionManager")
    void updateEquipmentTypeStauts(StatusVo statusVo) throws ObjectNotFoundException;


    Iterable<AnlogTypeVo> getAnlogTypeById(Long id, int page, int size);

    List<DeviceType> getEquipmentType() throws ArgumentErrorException;

}
